package online.takemehand.fx;

import javafx.application.Application;
import javafx.stage.Stage;

/**
 * 认识窗口
 */
public class Main extends Application {

    public static void main(String[] args) {
        launch(args);
    }

    @Override
    public void start(Stage primaryStage) throws Exception {
        //设置透明度
        primaryStage.setOpacity(0.5);
        //总是在最上层
        primaryStage.setAlwaysOnTop(true);
        //设置初始化距离边界的距离
        primaryStage.setX(100);
        primaryStage.setY(100);
        //监听x坐标
        primaryStage.xProperty().addListener((obs, oldVal, newVal) -> {
            System.out.println("x: " + newVal);
        });
        //监听y坐标
        primaryStage.yProperty().addListener((obs, oldVal, newVal) -> {
            System.out.println("y: " + newVal);
        });
        primaryStage.show();
    }
}
